home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright © 1991-1995 by TopSoft Inc. All rights reserved.
-
- You may distribute this file under the terms of the TopSoft
- Artistic License, accompanying this package.
-
- This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
- See the Modification History for more details.
-
- Product
- About Box
-
- FILE
- ABLinkedList.h
-
- NAME
- ABLinkedList.h, part of the ABox project source code,
- responsible for handling the AboutBox linked list class stuff.
-
- DESCRIPTION
- This file contains defines for the about box modules.
-
- DEVELOPED BY
- George (ty) Tempel netromancr@aol.com
- All code in this file, and its associated header file was
- Created by George (ty) Tempel in connection with the TopSoft, Inc.
- "FilterTop" application development, except where noted.
-
- CARETAKER - George (ty) Tempel <netromancr@aol.com>
- Please consult this person for any changes or suggestions to this file.
-
- MODIFICATION HISTORY
-
- dd mmm yy - xxx - patchxx: description of patch
- 9 June 94 - ty - Initial Version Created
- 20-july-94 - ty - initial version released
- 23-may-95 - ty - changes for compatibility with the CodeWarrior CW6
- release and the associated Universal Headers from Apple:
- most methods that returned references now have "Ref" at
- the end of their methods names to prevent possible collisions
- with datatypes and classes of the same name (older versions
- of the compiler didn't have a problem with this).
- */
-
- /*===========================================================================*/
-
- /*========== Exclusion Macros ============*/
-
- #pragma once
-
- #ifndef _ABLinkedList_
- #define _ABLinkedList_
-
-
- /*============ Header Files ==============*/
-
-
- /*=========== External Linkage ===========*/
-
- /*================ Macros ================*/
-
- /*============== Constants ===============*/
-
- /*================ Enums =================*/
-
- /*=============== Structs ================*/
-
- /*=============== Typedefs ===============*/
-
- typedef long ABListCount;
- typedef long ABIndex;
-
- typedef long ABMessage;
-
-
- /*=========== Class Definitions ==========*/
-
- //class ABLink : ABProperties
- class ABLink
- {
- friend class ABLinkedList;
-
- public:
- ABLink();
- virtual ~ABLink();
-
- virtual void Unlink(void);
-
- virtual ABIndex Ordinal(void);
-
- virtual ABLink *ExchangeWith (ABLink *itemToSwapIn);
-
- Boolean HasPreviousLink(void) const { return this->PreviousLink() != NULL; }
- Boolean HasNextLink(void) const { return this->NextLink() != NULL; }
- Boolean HasThisLink(void) const { return this->ThisLink() != NULL; }
-
- Boolean DoesntHavePreviousLink(void) const { return ! this->HasPreviousLink(); }
- Boolean DoesntHaveNextLink(void) const { return ! this->HasNextLink(); }
- Boolean DoesntHaveThisLink(void) const { return ! this->HasThisLink(); }
-
- protected:
- virtual ABLink *FindHead(void);
- virtual ABLink *FindTail(void);
- virtual void *Data(void);
-
- ABLink *mPreviousLink;
- ABLink *mThisLink;
- ABLink *mNextLink;
-
- ABLink*& PreviousLink(void) const { return mPreviousLink; }
- ABLink*& ThisLink(void) const { return mThisLink; }
- ABLink*& NextLink(void) const { return mNextLink; }
-
- private:
- };
-
-
-
- class ABLinkedList
- {
- public:
- ABLinkedList(void);
- virtual ~ABLinkedList(void);
-
- ABListCount Count(void) const { return this->ListCount(); }
- virtual ABLinkedList *Append(ABLink *item);
- virtual ABLinkedList *Detach(ABLink *item);
- virtual ABLink *NthLink(ABIndex n);
- virtual ABLink *NextLink(void);
- virtual ABLink *PreviousLink(void);
-
- virtual ABLink *FirstLink(void);
- virtual ABLink *LastLink(void);
- virtual ABLink *GetCurrentLink(void) const { return this->CurrentLink(); }
- virtual ABLink *GotoLink(ABIndex number);
-
- virtual OSErr ForEach (ABMessage message, void *data);
-
- Boolean HasListItems(void) const { return this->ListCount() > 0; }
- Boolean DoesntHaveListItems(void) const { return ! this->HasListItems(); }
- Boolean IsEmpty(void) const { return this->DoesntHaveListItems(); }
- Boolean IsNotEmpty(void) const { return ! this->IsEmpty(); }
- Boolean IsntEmpty(void) const { return this->IsNotEmpty(); }
-
- Boolean HasCurrentLink(void) const { return this->CurrentLink() != NULL; }
- Boolean DoesntHaveCurrentLink(void) const { return ! this->HasCurrentLink(); }
-
- protected:
- ABListCount mListCount;
- ABLink mHead;
- ABLink* mCurrentLink;
- ABLink mTail;
-
- ABListCount& ListCount(void) const { return mListCount; }
- ABLink& Head(void) const { return mHead; }
- ABLink*& CurrentLink(void) const { return mCurrentLink; }
- ABLink& Tail(void) const { return mTail; }
-
- private:
- };
-
- /*========== Function Prototypes =========*/
-
-
-
-
- #endif // _ABLinkedList_
-
-